You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > TOpenCLMtxVec Class > TOpenCLMtxVec Methods > DotProd Method > TOpenCLMtxVec.DotProd Method (int, [In] TOpenCLMtxVec, [In] TOpenCLMtxVec, [In] TOpenCLMtxVec)
Dew Math for .NET
ContentsIndexHome
Example
using Dew.Math; using Dew.Math.Units; namespace Dew.Examples() { void Example() { TOpenCLVector a,b,c; double[] ac; clMtxVec.CreateIt(out a, out b, out c); try { a.SetIt(false, new double[] {1,2,3,4}); b.SetIt(false, new double[] {5,6,7,8}); c.DotProd(0, a, b); // c[0] = 1*5 + 2*6 + * 3*7 + 4*8 c.DotProd(1, a, b); // c[0] = 1*5 + 2*6 + * 3*7 + 4*8 c.DotProd(2, a, b); // c[0] = 1*5 + 2*6 + * 3*7 + 4*8 c.CopyToArray(ac); //ac = [70, 70, 70] } finally { clMtxVec.FreeIt(ref a,ref b, ref c); } } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.